﻿@page "/login"


<PageTitle>Login</PageTitle>
<h3>Login</h3>

<EditForm Model="user" OnValidSubmit="HandleLogin">
    <DataAnnotationsValidator />
    <div class="mb-3">
        <label for="email">Email</label>
        <InputText id="email" @bind-Value="user.Email" class="form-control" />
        <ValidationMessage For="@(()=>user.Email)" />
    </div>
    <div class="mb-3">
        <label for="password">Password</label>
        <InputText id="password" @bind-Value="user.Password" class="form-control" type="password" />
        <ValidationMessage For="@(()=>user.Password)" />
    </div>

    <button type="submit" class="btn btn-primary">Login</button>


</EditForm>

@code {
    private UserLogin user = new UserLogin();

    private async Task HandleLogin()
    {
        Console.WriteLine("Log me in!");
    }
}
